//
//  QRnformationController.m
//  QRBuildScan
//
//  Created by gongjie on 12-1-3.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "QRnformationController.h"

@implementation QRnformationController
@synthesize qf_leftbuttn;
//- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
//{
//    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
//    if (self) {
//        // Custom initialization
//    }
//    return self;
//}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/
-(id)init{
    if (self = [super init]) {
        qf_leftbuttn = [UIButton buttonWithType:UIButtonTypeCustom];
        qf_leftbuttn.frame = CGRectMake(10,7, 60, 30);
        [qf_leftbuttn setBackgroundImage:[UIImage imageNamed:@"xiang.png"] forState:UIControlStateNormal];
        [qf_leftbuttn addTarget:self action:@selector(changhQFWleft) forControlEvents:UIControlEventTouchUpInside];
        [qf_leftbuttn retain];
        qf_Tableview = [[UITableView alloc] initWithFrame:CGRectMake(10, 10,300 ,100 ) style:UITableViewStyleGrouped];
        [qf_Tableview setBackgroundColor:[UIColor clearColor]];
        [qf_Tableview setDelegate:self];
        [qf_Tableview setDataSource:self];
        [self.view addSubview:qf_Tableview];
        qf_dizhi = nil;
    }
    return self;
}
-(void)changhQFWleft
{
    if (qf_leftbuttn.superview) {
        [qf_leftbuttn removeFromSuperview];
    }
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)setDizhi:(NSString*)di
{
    if (di!=nil&&di!=@"") {
        qf_dizhi = di;
        [qf_dizhi retain];
    }
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];

}
#pragma mark UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UIView* tview = [[[UIView alloc] initWithFrame:tableView.frame] autorelease];
	[tview setBackgroundColor:[UIColor clearColor]];
	[tableView setBackgroundView:tview];
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        cell.selectionStyle =UITableViewCellSelectionStyleNone;
        UILabel* tip1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 13, 250, 20)];
        tip1.tag = 1;
        [tip1 setBackgroundColor:[UIColor clearColor]];
        tip1.font = [UIFont systemFontOfSize:18];
        tip1.textColor = [UIColor blackColor];
        [cell.contentView addSubview:tip1];

    }
    UILabel* ilabel = (UILabel*)[cell.contentView viewWithTag:1];
     ilabel.text  = qf_dizhi;
    return cell;
}

#pragma mark UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 55;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(void)dealloc{
    [qf_Tableview release]; 
    qf_leftbuttn = nil;
    qf_dizhi = nil;
    [super dealloc];
}
@end
